package com.feri.ssm.controller;

import com.feri.ssm.entity.Msg;
import com.feri.ssm.entity.Pet;
import com.feri.ssm.service.intf.MsgService;
import com.feri.ssm.service.intf.PetService;
import com.feri.ssm.vo.PageVo;
import com.feri.ssm.vo.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/msg/")
public class MsgController {
    @Resource
    private MsgService service;

    //新增操作
    @PostMapping("add.do")
    public R add(Msg msg){
        return service.save(msg);
    }

    //删除操作
    @PostMapping("del.do")
    public R del(int id){
        return service.del(id);
    }

    //修改操作
    @PostMapping("update.do")
    public R update(Msg msg){
        return service.update(msg);
    }

    //查询操作
    @RequestMapping("selectAll.do")
    public PageVo selectAll(int page, int limit){
        return service.selectAll(page, limit);
    }

}
